﻿namespace Example.Structural
{
    using System;

    using Example.Structural.Proxy;

    using Xunit;

    /// <summary>
    /// Provide a surrogate or placeholder for another object to control access to it.
    /// </summary>
    public sealed class ProxyFacts
    {
        [Fact]
        public void favicon_exists()
        {
            var favicon = new Favicon(new Uri("http://www.alan-dean.com/"));

            Assert.Equal(16, favicon.Image.Height);
            Assert.Equal(16, favicon.Image.Width);

            Assert.Equal(new Uri("http://www.alan-dean.com/favicon.ico"), favicon.Location);
        }

        [Fact(Skip = "example.com has changed.")]
        public void favicon_missing()
        {
            var favicon = new Favicon(new Uri("http://www.example.com/"));

            Assert.Null(favicon.Image);
        }
    }
}